<template>
  <div>
    <div class="title">热销推荐</div>
    <ul class="item">
      <router-link tag="li" :to="/detail/+ item.id" class="border-bottom" v-for="item of recommendData" :key="item.id">
        <div class="item-left">
          <img class="item-img" :src="item.url" />
        </div>
        <div class="item-right">
          <h2>{{item.title}}</h2>
          <p class="item-pl">{{item.desc}}</p>
          <button class="item-button">查看详情</button>
        </div>
      </router-link>
    </ul>
  </div>
</template>

<script>
export default {
  name: 'HomeRecommend',
  props: {
    recommendData: Array
  },
  data: function () {
    return {
    }
  }
}
</script>

<style lang="stylus" scoped>
  @import "~styles/varibles.styl"
  .title
    width:100%
    height: 0.8rem
    background: #eee
    font-size: 0.3rem
    text-indent: 0.2rem
    line-height: 0.8rem
    margin-top 0.2rem
  .item
    width: 100%
  .item li
    display: flex
    height:2.38rem
    padding: .2rem
    .item-left
      float: left
      width:2rem
      height:2rem
      .item-img
          height:100%
    .item-right
      flex:1
      margin-left: .2rem
      margin-top: .3rem
      min-width :0
      h2
        font-size:.35rem
        margin-bottom: .25rem
        ellipsi()
      .item-pl
        font-size: .18rem
        ellipsi()
      .item-button
        display:block
        background: #ff9300
        padding: 0.1 0.2rem
        border-radius: 0.08rem
        font-size: 0.16rem
        color: #fff
        margin-top: 0.2rem
        border:none
</style>
